package io.sk.im.api;

import io.sk.common.base.BaseController;
import io.sk.common.base.BaseResult;
import io.sk.common.utils.R;
import io.sk.im.entity.UserAccountInfo;
import io.sk.im.service.IUserAccountService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author rql
 * @version 1.0.0
 * @date 2018/5/10 11:27
 * @description
 */
@RestController
@RequestMapping("/api/im")
@Api(tags = "im注册接口")
public class  UserAccountController extends BaseController {

    @Autowired
    private IUserAccountService iUserAccountService;


    /**
     * 注册接口
     * @param userAccountInfo
     * @return
     */
    @PostMapping("/add")
    public BaseResult<UserAccountInfo> add(@RequestBody UserAccountInfo userAccountInfo){
        boolean result=iUserAccountService.insert(userAccountInfo);
        return result?sendResult200():sendResult500();
    }
}
